Don't crash on NULL parent
authorAlexander Larsson <alexl@redhat.com>
Mon, 17 Aug 2009 14:59:47 +0000 (16:59 +0200)
committerAlexander Larsson <alexl@redhat.com>
Mon, 17 Aug 2009 14:59:47 +0000 (16:59 +0200)
The parent window can be NULL, check for that before dereferencing.

gdk/gdkwindow.c

index b9d0bfff6dcde6c97b48e6a915d6c810bcbe3950..87066087d7c215a92238a5477fd2dbb044a41bfa 100644 (file)
@@ -7295,7 +7295,7 @@ gdk_window_get_geometry (GdkWindow *window,
          /* This reports the position wrt to the native parent, we need to convert
             it to be relative to the client side parent */
          parent = private->parent;
-         if (!gdk_window_has_impl (parent))
+         if (parent && !gdk_window_has_impl (parent))
            {
              *x -= parent->abs_x;
              *y -= parent->abs_y;